#! /bin/bash

set -e -x

sudo -E -u hdfs hadoop fs -mkdir -p /tmp/hadoop-yarn/staging/history/done_intermediate
sudo -E -u hdfs hadoop fs -chown -R mapred:mapred /tmp/hadoop-yarn/staging
sudo -E -u hdfs hadoop fs -chmod -R 777 /tmp
sudo -E -u hdfs hadoop fs -mkdir -p /var/log/hadoop-yarn
sudo -E -u hdfs hadoop fs -chown yarn:mapred /var/log/hadoop-yarn

chown mapred /var/log/hadoop-mapreduce
